home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
text
/
edit
/
envwrd41.lha
/
envWRD41
/
source
/
words
/
sprintf.a
< prev
next >
Wrap
Text File
|
1994-09-25
|
763b
|
39 lines
;
; Simple version of the C "sprintf" function. Assumes C-style
; stack-based function conventions.
;
; long eyecount;
; eyecount=2;
; sprintf(string,"%s have %ld eyes.","Fish",eyecount);
;
; would produce "Fish have 2 eyes." in the string buffer.
;
xdef _myprintf
xref _SysBase
xref _LVORawDoFmt
SECTION sprintf,CODE
_myprintf:
movem.l a2/a3/a6,-(sp)
move.l 16(sp),a3
move.l 20(sp),a0
lea.l 24(sp),a1
lea.l stuffChar(pc),a2
move.l _SysBase,a6
jsr _LVORawDoFmt(a6)
movem.l (sp)+,a2/a3/a6
move.l 4(sp),d0
rts
;------ PutChProc function used by RawDoFmt -----------
stuffChar:
move.b d0,(a3)+
rts
END